<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>location地址栏</title>
</head>
<body>

<script>
    // location的href属性: 获取地址栏的所有内容
    let href = location.href;
    //alert(href)

    // location的href属性: 修改地址栏的所有内容 (可以跳转网页)

    //location.href = "https:www.baidu.com";
    // 3秒跳转到百度
    time=3000;

    // setTimeout(function () {
    //     location.href = "https:www.baidu.com";
    // },time)

    // 面试题
    // location是window的属性可以省略window
    let href1 = location.href;
    document.write(href1 + "<br>");
    // location的href属性可以省略
    let location1 = location;
    document.write(location1 + "<br>");

</script>
</body>
</html>